﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using model;
using Bll;

public partial class GoWhere : System.Web.UI.Page
{
    StudentBll bll = new StudentBll();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            Student st = bll.GetSingle(Session["userid"].ToString());
            ddlGo.Text = st.Go;
            txtGoto.Text = st.Gowhere;
        }
    }
    protected void btnUpdate_Click(object sender, EventArgs e)
    {
        
        Student student = new Student();
        student.Go = ddlGo.Text;
        student.Gowhere = txtGoto.Text;
        student.Sno = Session["userid"].ToString();
        bll.UpdateGo(student);
        Response.Write("<script>alert('更新成功!');location.href('Default.aspx');</script>");
    }
}